
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>6.10. mobxUtils.createTransformer · MobX 中文文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="expr.html" />
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"SangKa","repo":"MobX-Docs-CN","type":"star","size":"small","count":true},{"user":"SangKa","repo":"MobX-Docs-CN","type":"fork","size":"small","count":true}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    1. MobX 介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../intro/overview.html">
            
                <a href="../intro/overview.html">
            
                    
                    1.1. MobX 要点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../intro/concepts.html">
            
                <a href="../intro/concepts.html">
            
                    
                    1.2. 概念与原则
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="api.html">
            
                <a href="api.html">
            
                    
                    2. API概览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    3. observable 相关
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="observable.html">
            
                <a href="observable.html">
            
                    
                    3.1. observable
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="observable-decorator.html">
            
                <a href="observable-decorator.html">
            
                    
                    3.2. @observable
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="object.html">
            
                <a href="object.html">
            
                    
                    3.3. objects
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="array.html">
            
                <a href="array.html">
            
                    
                    3.4. arrays
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="map.html">
            
                <a href="map.html">
            
                    
                    3.5. maps
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="boxed.html">
            
                <a href="boxed.html">
            
                    
                    3.6. boxed values
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="modifiers.html">
            
                <a href="modifiers.html">
            
                    
                    3.7 decorators
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    4. 对 observables 作出响应
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="computed-decorator.html">
            
                <a href="computed-decorator.html">
            
                    
                    4.1. (@)computed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="autorun.html">
            
                <a href="autorun.html">
            
                    
                    4.2. autorun
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="when.html">
            
                <a href="when.html">
            
                    
                    4.3. when
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="reaction.html">
            
                <a href="reaction.html">
            
                    
                    4.4. reaction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="observer-component.html">
            
                <a href="observer-component.html">
            
                    
                    4.5. (@)observer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../best/react.html">
            
                <a href="../best/react.html">
            
                    
                    4.6. 理解 MobX 对何作出响应
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    5. 改变 observables
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="action.html">
            
                <a href="action.html">
            
                    
                    5.1. action
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../best/actions.html">
            
                <a href="../best/actions.html">
            
                    
                    5.2. async actions & flows
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="object-api.html">
            
                <a href="object-api.html">
            
                    
                    5.3. Object api
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    6. 工具函数
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="tojson.html">
            
                <a href="tojson.html">
            
                    
                    6.1. toJS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="extend-observable.html">
            
                <a href="extend-observable.html">
            
                    
                    6.2. extendObservable
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="extending.html">
            
                <a href="extending.html">
            
                    
                    6.3. createAtom
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="observe.html">
            
                <a href="observe.html">
            
                    
                    6.4. intercept & observe
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#frompromise">
            
                    
                    6.5. mobxUtils.fromPromise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#fromresource">
            
                    
                    6.6. mobxUtils.fromResource
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#tostream">
            
                    
                    6.7. mobxUtils.toStream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#fromstream">
            
                    
                    6.8. mobxUtils.fromStream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#now">
            
                    
                    6.9. mobxUtils.now
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6.10" data-path="create-transformer.html">
            
                <a href="create-transformer.html">
            
                    
                    6.10. mobxUtils.createTransformer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="expr.html">
            
                <a href="expr.html">
            
                    
                    6.11. mobxUtils.expr
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" data-path="api.html">
            
                <a href="api.html">
            
                    
                    6.12. complete api overview
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <a target="_blank" href="https://github.com/mobxjs/awesome-mobx#examples">
            
                    
                    7. 博客、 视频及相关项目
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" >
            
                <span>
            
                    
                    8. 贴士与技巧
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../faq/faq.html">
            
                <a href="../faq/faq.html">
            
                    
                    8.1. 常见问题解答
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../best/pitfalls.html">
            
                <a href="../best/pitfalls.html">
            
                    
                    8.2. 常见陷阱与最佳实践
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../best/decorators.html">
            
                <a href="../best/decorators.html">
            
                    
                    8.3. 如何(不)使用装饰器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../best/trace.html">
            
                <a href="../best/trace.html">
            
                    
                    8.4. 使用 trace 进行调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../best/store.html">
            
                <a href="../best/store.html">
            
                    
                    8.5. 定义数据存储
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../best/react-performance.html">
            
                <a href="../best/react-performance.html">
            
                    
                    8.6. 优化 React 组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../best/devtools.html">
            
                <a href="../best/devtools.html">
            
                    
                    8.7. 开发工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="spy.html">
            
                <a href="spy.html">
            
                    
                    8.8. spy
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../donating.html">
            
                <a href="../donating.html">
            
                    
                    9. 捐赠
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >6.10. mobxUtils.createTransformer</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="createtransformer"><a name="createtransformer" class="plugin-anchor" href="#createtransformer"><i class="fa fa-link" aria-hidden="true"></i></a>createTransformer</h1>
<p>&#x7531; <code>mobx-utils</code> &#x5305;&#x63D0;&#x4F9B;&#x3002;</p>
<p><code>createTransformer&lt;A, B&gt;(transformation: (value: A) =&gt; B, onCleanup?: (result: B, value?: A) =&gt; void): (value: A) =&gt; B</code></p>
<p><code>createTransformer</code> &#x5C06;&#x4E00;&#x4E2A;&#x51FD;&#x6570;(&#x6B64;&#x51FD;&#x6570;&#x503C; <code>A</code> &#x8F6C;&#x6362;&#x4E3A;&#x503C; <code>B</code>)&#x8F6C;&#x6362;&#x4E3A;&#x54CD;&#x5E94;&#x5F0F;&#x4E14;&#x6709;&#x8BB0;&#x5FC6;&#x529F;&#x80FD;&#x7684;&#x51FD;&#x6570;&#x3002;
&#x6362;&#x53E5;&#x8BDD;&#x8BF4;&#xFF0C;&#x5982;&#x679C;&#x7ED9; <code>transformation</code> &#x51FD;&#x6570;&#x4E00;&#x4E2A;&#x5177;&#x4F53;&#x7684;A&#x503C;&#xFF0C;&#x90A3;&#x4E48;&#x5B83;&#x5C06;&#x8BA1;&#x7B97;&#x51FA;B&#x503C;&#xFF0C;&#x53EA;&#x8981;&#x4FDD;&#x6301;A&#x503C;&#x4E0D;&#x53D8;&#xFF0C;&#x90A3;&#x4E48;&#x4ECA;&#x540E;&#x4EFB;&#x4F55;&#x65F6;&#x5019;&#x7684;&#x8F6C;&#x6362;&#x8C03;&#x7528;&#x8FD4;&#x56DE;&#x7684;B&#x503C;&#x4E5F;&#x662F;&#x4E0D;&#x53D8;&#x7684;&#x3002;
&#x4F46;&#x662F;&#xFF0C;&#x5982;&#x679C;A&#x503C;&#x6539;&#x53D8;&#x4E86;&#xFF0C;&#x5C06;&#x4F1A;&#x91CD;&#x65B0;&#x5E94;&#x7528;&#x8F6C;&#x6362;&#xFF0C;&#x4EE5;&#x4FBF;&#x76F8;&#x5E94;&#x5730;&#x66F4;&#x65B0;B&#x503C;&#x3002;
&#x6700;&#x540E;&#x4F46;&#x540C;&#x6837;&#x91CD;&#x8981;&#x7684;&#x662F;&#xFF0C;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x4EBA;&#x5728;&#x4F7F;&#x7528;&#x5177;&#x4F53;A&#x503C;&#x7684;&#x8F6C;&#x6362;&#xFF0C;&#x5219;&#x6B64;&#x6761;&#x8F6C;&#x6362;&#x5C06;&#x4ECE;&#x8BB0;&#x5FC6;&#x8868;&#x4E2D;&#x79FB;&#x9664;&#x3002;</p>
<p>&#x4F7F;&#x7528; <code>createTransformer</code> &#x53EF;&#x4EE5;&#x5F88;&#x5BB9;&#x6613;&#x7684;&#x5C06;&#x4E00;&#x4E2A;&#x5B8C;&#x6574;&#x6570;&#x636E;&#x56FE;&#x8F6C;&#x6362;&#x6210;&#x53E6;&#x5916;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x56FE;&#x3002;
&#x8F6C;&#x6362;&#x51FD;&#x6570;&#x53EF;&#x4EE5;&#x7EC4;&#x5408;&#xFF0C;&#x8FD9;&#x6837;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5F88;&#x591A;&#x5C0F;&#x7684;&#x8F6C;&#x6362;&#x51FD;&#x6570;&#x6765;&#x6784;&#x5EFA;&#x4E00;&#x68F5;&#x54CD;&#x5E94;&#x6811;&#x3002;
&#x751F;&#x6210;&#x7684;&#x6570;&#x636E;&#x56FE;&#x4F1A;&#x4E00;&#x76F4;&#x4FDD;&#x6301;&#x66F4;&#x65B0;&#xFF0C;&#x5B83;&#x5C06;&#x901A;&#x8FC7;&#x5BF9;&#x7ED3;&#x679C;&#x56FE;&#x5E94;&#x7528;&#x5C0F;&#x8865;&#x4E01;&#x6765;&#x4E0E;&#x6E90;&#x540C;&#x6B65;&#x3002;
&#x8FD9;&#x4F7F;&#x5F97;&#x5B83;&#x5F88;&#x5BB9;&#x6613;&#x5B9E;&#x73B0;&#x5F3A;&#x5927;&#x7684;&#x6A21;&#x5F0F;&#x7C7B;&#x4F3C;&#x4E8E; <code>sideways data loading</code>&#x3001;map-reduce&#x3001;&#x4F7F;&#x7528;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x8DDF;&#x8E2A;&#x72B6;&#x6001;&#x5386;&#x53F2;&#x7B49;&#x7B49;&#x3002;</p>
<p>&#x53EF;&#x9009;&#x7684; <code>onCleanup</code> &#x51FD;&#x6570;&#x53EF;&#x7528;&#x4E8E;&#x5728;&#x4E0D;&#x518D;&#x9700;&#x8981;&#x5BF9;&#x8C61;&#x7684;&#x8F6C;&#x6362;&#x65F6;&#x83B7;&#x53D6;&#x901A;&#x77E5;&#x3002;
&#x5982;&#x679C;&#x9700;&#x8981;&#xFF0C;&#x8FD9;&#x53EF;&#x4EE5;&#x7528;&#x4E8E;&#x6E05;&#x7406;&#x9644;&#x52A0;&#x5230;&#x7ED3;&#x679C;&#x5BF9;&#x8C61;&#x4E0A;&#x7684;&#x8D44;&#x6E90;&#x3002;</p>
<p>&#x6C38;&#x8FDC;&#x5728; <code>@observer</code> &#x6216; <code>autorun</code> &#x8FD9;&#x6837;&#x7684; reaction &#x4E2D;&#x4F7F;&#x7528;&#x8F6C;&#x6362;&#x3002;
&#x5982;&#x540C;&#x4EFB;&#x4F55;&#x5176;&#x4ED6;&#x8BA1;&#x7B97;&#x503C;&#x4E00;&#x6837;&#xFF0C;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x88AB;&#x67D0;&#x4E9B;&#x4E1C;&#x897F;&#x89C2;&#x5BDF;&#x7684;&#x8BDD;&#xFF0C;&#x8FD9;&#x4E9B;&#x8F6C;&#x6362;&#x4E5F;&#x5C06;&#x4F1A;&#x56DE;&#x9000;&#x5230;&#x60F0;&#x6027;&#x6C42;&#x503C;&#xFF0C;&#x5C3D;&#x7BA1;&#x6709;&#x70B9;&#x8FDD;&#x80CC;&#x4F7F;&#x7528;&#x5B83;&#x4EEC;&#x7684;&#x521D;&#x8877;&#x3002;</p>
<p>&#x8FD9;&#x4E00;&#x5207;&#x53EF;&#x80FD;&#x4ECD;&#x7136;&#x6709;&#x70B9;&#x6A21;&#x7CCA;&#xFF0C;&#x56E0;&#x6B64;&#x8FD9;&#x91CC;&#x901A;&#x8FC7;&#x7528;&#x4E24;&#x4E2A;&#x4F7F;&#x7528;&#x5C0F;&#x7684;&#x54CD;&#x5E94;&#x5F0F;&#x51FD;&#x6570;&#x5C06;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x8F6C;&#x6362;&#x6210;&#x53E6;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x793A;&#x4F8B;&#x6765;&#x89E3;&#x91CA;&#x8FD9;&#x8F6C;&#x6362;&#x7684;&#x6574;&#x4F53;&#x601D;&#x8DEF;:</p>
<h2 id="&#x4F7F;&#x7528;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#x3001;&#x540C;&#x4EAB;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x6765;&#x8FFD;&#x8E2A;&#x53EF;&#x53D8;&#x72B6;&#x6001;"><a name="&#x4F7F;&#x7528;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#x3001;&#x540C;&#x4EAB;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x6765;&#x8FFD;&#x8E2A;&#x53EF;&#x53D8;&#x72B6;&#x6001;" class="plugin-anchor" href="#&#x4F7F;&#x7528;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#x3001;&#x540C;&#x4EAB;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x6765;&#x8FFD;&#x8E2A;&#x53EF;&#x53D8;&#x72B6;&#x6001;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4F7F;&#x7528;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#x3001;&#x540C;&#x4EAB;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x6765;&#x8FFD;&#x8E2A;&#x53EF;&#x53D8;&#x72B6;&#x6001;</h2>
<p>&#x672C;&#x793A;&#x4F8B;&#x53D6;&#x81EA; <a href="https://github.com/mobxjs/mobx-reactive2015-demo" target="_blank">Reactive2015 conference demo</a>:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">/*
    store &#x4FDD;&#x5B58;&#x4E86;&#x6211;&#x4EEC;&#x7684;&#x9886;&#x57DF;&#x5BF9;&#x8C61;: boxes &#x548C; arrows
*/</span>
<span class="hljs-keyword">const</span> store = observable({
    boxes: [],
    arrows: [],
    selection: <span class="hljs-literal">null</span>
});

<span class="hljs-comment">/**
    &#x6BCF;&#x6B21;&#x66F4;&#x6539;&#x4F1A;&#x628A; store &#x5E8F;&#x5217;&#x5316;&#x6210; json &#x5E76;&#x5C06;&#x5176;&#x6DFB;&#x52A0;&#x5230;&#x72B6;&#x6001;&#x5217;&#x8868;&#x4E2D;
*/</span>
<span class="hljs-keyword">const</span> states = [];

autorun(() =&gt; {
    states.push(serializeState(store));
});

<span class="hljs-keyword">const</span> serializeState = createTransformer(store =&gt; ({
    boxes: store.boxes.map(serializeBox),
    arrows: store.arrows.map(serializeArrow),
    selection: store.selection ? store.selection.id : <span class="hljs-literal">null</span>
}));

<span class="hljs-keyword">const</span> serializeBox = createTransformer(box =&gt; ({...box}));

<span class="hljs-keyword">const</span> serializeArrow = createTransformer(arrow =&gt; ({
    id: arrow.id,
    to: arrow.to.id,
    <span class="hljs-keyword">from</span>: arrow.from.id
}));
</code></pre>
<p>&#x5728;&#x672C;&#x793A;&#x4F8B;&#x4E2D;&#xFF0C;state &#x662F;&#x901A;&#x8FC7;&#x7EC4;&#x5408;&#x4E09;&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x8F6C;&#x6362;&#x51FD;&#x6570;&#x5E8F;&#x5217;&#x5316;&#x8FC7;&#x7684;&#x3002;
autorunner &#x89E6;&#x53D1; <code>store</code> &#x5BF9;&#x8C61;&#x7684;&#x5E8F;&#x5217;&#x5316;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x4F9D;&#x6B21;&#x5C06; boxes &#x548C; arrows &#x5E8F;&#x5217;&#x5316;&#x3002;
&#x6211;&#x4EEC;&#x6765;&#x4ED4;&#x7EC6;&#x770B;&#x4E0B;&#x4E00;&#x4E2A;&#x793A;&#x4F8B; box#3 &#x5047;&#x60F3;&#x7684;&#x751F;&#x547D;&#x5468;&#x671F;&#x3002;</p>
<ol>
<li>&#x9996;&#x5148; box#3 &#x662F;&#x901A;&#x8FC7; <code>map</code> &#x4F20;&#x9012;&#x7ED9; <code>serializeBox</code> &#x7684;&#xFF0C;&#x6267;&#x884C; serializeBox &#x8F6C;&#x6362;&#x7136;&#x540E;&#x5305;&#x542B; box#3 &#x7684;&#x6761;&#x76EE;&#x53CA;&#x5176;&#x5E8F;&#x5217;&#x5316;&#x8868;&#x793A;&#x4F1A;&#x88AB;&#x6DFB;&#x52A0;&#x5230; <code>serializeBox</code> &#x7684;&#x5185;&#x90E8;&#x8BB0;&#x5FC6;&#x8868;&#x4E2D;&#x3002;</li>
<li>&#x5047;&#x5982;&#x6709;&#x53E6;&#x4E00;&#x4E2A; box &#x88AB;&#x6DFB;&#x52A0;&#x5230; <code>store.boxes</code> &#x5217;&#x8868;&#x4E2D;&#x3002;
&#x8FD9;&#x4F1A;&#x5BFC;&#x81F4; <code>serializeState</code> &#x51FD;&#x6570;&#x518D;&#x6B21;&#x8BA1;&#x7B97;&#xFF0C;&#x7ED3;&#x679C;&#x5C31;&#x662F;&#x6240;&#x6709; boxes &#x7684;&#x5B8C;&#x5168;&#x91CD;&#x65B0;&#x6620;&#x5C04;&#x3002;
&#x7136;&#x800C;&#xFF0C;&#x6240;&#x6709;&#x7684; <code>serializeBox</code> &#x7684;&#x8C03;&#x7528;&#x90FD;&#x4F1A;&#x8FD4;&#x56DE;&#x5B83;&#x4EEC;&#x4FDD;&#x5B58;&#x5728;&#x5185;&#x90E8;&#x8BB0;&#x5FC6;&#x8868;&#x4E2D;&#x7684;&#x65E7;&#x503C;&#xFF0C;&#x8FD9;&#x6837;&#x5B83;&#x4EEC;&#x7684;&#x8F6C;&#x6362;&#x51FD;&#x6570;&#x4E0D;&#x4F1A;(&#x9700;&#x8981;)&#x518D;&#x6B21;&#x8FD0;&#x884C;&#x3002;</li>
<li>&#x63A5;&#x4E0B;&#x6765;&#xFF0C;&#x5982;&#x679C;&#x6709;&#x4EBA;&#x6539;&#x53D8;&#x4E86; box#3 &#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x8FD9;&#x4F1A;&#x5BFC;&#x81F4; box#3 &#x7684; <code>serializeBox</code> &#x7A0B;&#x5E8F;&#x91CD;&#x65B0;&#x8BA1;&#x7B97;&#xFF0C;&#x5C31;&#x50CF; MobX &#x4E2D;&#x7684;&#x5176;&#x4ED6;&#x54CD;&#x5E94;&#x5F0F;&#x51FD;&#x6570;&#x4E00;&#x6837;&#x3002;
&#x56E0;&#x4E3A;&#x8F6C;&#x6362;&#x4F1A;&#x4EA7;&#x751F;&#x4E00;&#x4E2A;&#x57FA;&#x4E8E; box#3 &#x7684;&#x65B0;&#x7684; json &#x5BF9;&#x8C61;&#xFF0C;&#x5BF9;&#x5E94;&#x7684;&#x8F6C;&#x6362;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x89C2;&#x5BDF;&#x8005;&#x90FD;&#x88AB;&#x5F3A;&#x5236;&#x91CD;&#x65B0;&#x8FD0;&#x884C;&#x3002;
&#x5728;&#x8FD9;&#x4E2A;&#x793A;&#x4F8B;&#x4E2D;&#x5BF9;&#x5E94;&#x7684;&#x662F; <code>serializeState</code> &#x8F6C;&#x6362;&#x3002;
<code>serializeState</code> &#x4F1A;&#x4F9D;&#x6B21;&#x4EA7;&#x751F;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x503C;&#x5E76;&#x518D;&#x6B21;&#x6620;&#x5C04;&#x6240;&#x6709;&#x7684; boxex &#x3002;&#x4F46;&#x9664;&#x4E86; box#3&#xFF0C;&#x5176;&#x4ED6;&#x6240;&#x6709;&#x7684; boxes &#x90FD;&#x662F;&#x4ECE;&#x5185;&#x90E8;&#x8BB0;&#x5FC6;&#x8868;&#x4E2D;&#x76F4;&#x63A5;&#x8FD4;&#x56DE;&#x7684;&#x3002;</li>
<li>&#x6700;&#x540E;&#xFF0C;&#x5982;&#x679C; box#3 &#x4ECE; <code>store.boxes</code> &#x79FB;&#x9664;&#x4E86;&#xFF0C;&#x90A3;&#x4E48; <code>serializeState</code> &#x4F1A;&#x91CD;&#x65B0;&#x8BA1;&#x7B97;&#x3002;
&#x4F46;&#x662F;&#x7531;&#x4E8E;&#x5B83;&#x4E0D;&#x518D;&#x4F7F;&#x7528; <code>serializeBox</code> &#x7684;&#x7A0B;&#x5E8F;&#x64CD;&#x4F5C; box#3&#xFF0C;&#x54CD;&#x5E94;&#x5F0F;&#x51FD;&#x6570;&#x4F1A;&#x56DE;&#x9000;&#x6210;&#x975E;&#x54CD;&#x5E94;&#x6A21;&#x5F0F;&#x3002;
&#x7136;&#x540E;&#x901A;&#x77E5;&#x5185;&#x90E8;&#x8BB0;&#x5FC6;&#x8868;&#xFF0C;&#x8BE5;&#x6761;&#x76EE;&#x53EF;&#x4EE5;&#x88AB;&#x5220;&#x9664;&#xFF0C;&#x4EE5;&#x4FBF;&#x5B83;&#x51C6;&#x5907;&#x597D; GC&#x3002;</li>
</ol>
<p>&#x6240;&#x4EE5;&#x5728;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#x3001;&#x5171;&#x4EAB;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x6709;&#x6548;&#x5730;&#x5B9E;&#x73B0;&#x4E86;&#x72B6;&#x6001;&#x8FFD;&#x8E2A;&#x3002;
&#x6240;&#x6709;&#x7684; boxes &#x548C; arrows &#x90FD;&#x6620;&#x5C04;&#x5E76;&#x7B80;&#x5316;&#x5230;&#x4E00;&#x4E2A;&#x72B6;&#x6001;&#x6811;&#x3002;
&#x6BCF;&#x6B21;&#x53D8;&#x5316;&#x90FD;&#x4F1A;&#x5BFC;&#x81F4; <code>states</code> &#x6570;&#x7EC4;&#x4E2D;&#x4EA7;&#x751F;&#x4E00;&#x4E2A;&#x65B0;&#x6761;&#x76EE;&#xFF0C;&#x4F46;&#x4E0D;&#x540C;&#x7684;&#x6761;&#x76EE;&#x5C06;&#x5206;&#x4EAB;&#x51E0;&#x4E4E;&#x6240;&#x6709;&#x7684; box &#x548C; arrow &#x72B6;&#x6001;&#x8868;&#x73B0;&#x3002;</p>
<h2 id="&#x5C06;&#x6570;&#x636E;&#x56FE;&#x8F6C;&#x6362;&#x4E3A;&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;&#x56FE;"><a name="&#x5C06;&#x6570;&#x636E;&#x56FE;&#x8F6C;&#x6362;&#x4E3A;&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;&#x56FE;" class="plugin-anchor" href="#&#x5C06;&#x6570;&#x636E;&#x56FE;&#x8F6C;&#x6362;&#x4E3A;&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;&#x56FE;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5C06;&#x6570;&#x636E;&#x56FE;&#x8F6C;&#x6362;&#x4E3A;&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;&#x56FE;</h2>
<p>&#x8F6C;&#x6362;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x7684;&#x662F;&#x666E;&#x901A;&#x503C;&#xFF0C;&#x4F5C;&#x4E3A;&#x66FF;&#x4EE3;&#x8FD8;&#x53EF;&#x4EE5;&#x8FD4;&#x56DE; observable &#x5BF9;&#x8C61;&#x3002;
&#x8FD9;&#x4E2A;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x628A;&#x4E00;&#x4E2A; observable &#x6570;&#x636E;&#x56FE;&#x8F6C;&#x6362;&#x6210;&#x53E6;&#x5916;&#x4E00;&#x4E2A; observable &#x6570;&#x636E;&#x56FE;&#xFF0C;&#x5F97;&#x5230;&#x7684;&#x53C8;&#x53EF;&#x4EE5;&#x8FDB;&#x884C;&#x8F6C;&#x6362;...&#x4F60;&#x61C2;&#x5F97;&#x3002;</p>
<p>&#x8FD9;&#x6709;&#x4E2A;&#x5C0F;&#x793A;&#x4F8B;&#xFF0C;&#x662F;&#x5BF9;&#x4E00;&#x4E2A;&#x54CD;&#x5E94;&#x5F0F;&#x6587;&#x4EF6;&#x63A2;&#x6D4B;&#x5668;&#x8FDB;&#x884C;&#x7F16;&#x7801;&#xFF0C;&#x5B83;&#x5C06;&#x5728;&#x6BCF;&#x6B21;&#x66F4;&#x6539;&#x65F6;&#x8FDB;&#x884C;&#x66F4;&#x65B0;&#x3002;
&#x4EE5;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x6784;&#x5EFA;&#x7684;&#x6570;&#x636E;&#x56FE;&#x901A;&#x5E38;&#x53CD;&#x5E94;&#x66F4;&#x5FEB;&#xFF0C;&#x5E76;&#x4E14;&#x4E0E;&#x4F7F;&#x7528;&#x4F60;&#x81EA;&#x5DF1;&#x7684;&#x4EE3;&#x7801;&#x66F4;&#x65B0;&#x7684;&#x884D;&#x751F;&#x6570;&#x636E;&#x56FE;&#x76F8;&#x6BD4;,&#x4EE3;&#x7801;&#x4F1A;&#x66F4;&#x4E3A;&#x76F4;&#x89C2;&#xFF0C;&#x3002;&#x53C2;&#x89C1;&#x4E00;&#x4E9B;&#x793A;&#x4F8B;&#x7684;<a href="https://github.com/mobxjs/mobx/blob/3ea1f4af20a51a1cb30be3e4a55ec8f964a8c495/test/perf/transform-perf.js#L4" target="_blank">&#x6027;&#x80FD;&#x6D4B;&#x8BD5;</a>&#x3002;</p>
<p>&#x4E0D;&#x540C;&#x4E8E;&#x524D;&#x4E00;&#x4E2A;&#x793A;&#x4F8B;&#x7684;&#x662F;&#xFF0C;<code>transformFolder</code> &#x5728;&#x6587;&#x4EF6;&#x5939;&#x4FDD;&#x6301;&#x53EF;&#x89C1;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x53EA;&#x4F1A;&#x8FD0;&#x884C;&#x4E00;&#x6B21;&#x3002;
<code>DisplayFolder</code> &#x5BF9;&#x8C61;&#x8FFD;&#x8E2A; <code>Folder</code> &#x5BF9;&#x8C61;&#x672C;&#x8EAB;&#x76F8;&#x5173;&#x7684;&#x4E1C;&#x897F;&#x3002;</p>
<p>&#x5728;&#x4E0B;&#x9762;&#x7684;&#x793A;&#x4F8B;&#x4E2D;&#xFF0C; <code>state</code> &#x56FE;&#x7684;&#x6240;&#x6709;&#x53D8;&#x5316;&#x90FD;&#x4F1A;&#x88AB;&#x81EA;&#x52A8;&#x5904;&#x7406;&#x3002;
&#x4E00;&#x4E9B;&#x793A;&#x4F8B;:</p>
<ol>
<li>&#x6539;&#x53D8;&#x6587;&#x4EF6;&#x5939;&#x7684;&#x540D;&#x79F0;&#x4F1A;&#x66F4;&#x65B0;&#x5BF9;&#x5E94;&#x7684; <code>path</code> &#x5C5E;&#x6027;&#x548C;&#x5176;&#x6240;&#x6709;&#x540E;&#x4EE3;&#x7684; <code>path</code> &#x5C5E;&#x6027;&#x3002;</li>
<li>&#x6298;&#x53E0;&#x6587;&#x4EF6;&#x5939;&#x4F1A;&#x5C06;&#x4ECE;&#x6811;&#x4E2D;&#x5220;&#x9664;&#x6240;&#x6709;&#x540E;&#x4EE3;&#x7684; <code>DisplayFolders</code>&#x3002;</li>
<li>&#x5C55;&#x5F00;&#x6587;&#x4EF6;&#x5939;&#x5C06;&#x518D;&#x6B21;&#x6062;&#x590D;&#x3002;</li>
<li>&#x8BBE;&#x7F6E;&#x641C;&#x7D22;&#x8FC7;&#x6EE4;&#x5668;&#x5C06;&#x5220;&#x9664;&#x4E0D;&#x5339;&#x914D;&#x8FC7;&#x6EE4;&#x5668;&#x7684;&#x6240;&#x6709;&#x8282;&#x70B9;&#xFF0C;&#x9664;&#x975E;&#x5B83;&#x4EEC;&#x6709;&#x4E0E;&#x8FC7;&#x6EE4;&#x5668;&#x5339;&#x914D;&#x7684;&#x540E;&#x4EE3;&#x8282;&#x70B9;&#x3002;</li>
<li>&#x7B49;&#x7B49;...</li>
</ol>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> m = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;mobx&apos;</span>)

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Folder</span>(<span class="hljs-params">parent, name</span>) </span>{
    <span class="hljs-keyword">this</span>.parent = parent;
    m.extendObservable(<span class="hljs-keyword">this</span>, {
        name: name,
        children: m.observable.shallow([]),
    });
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">DisplayFolder</span>(<span class="hljs-params">folder, state</span>) </span>{
    <span class="hljs-keyword">this</span>.state = state;
    <span class="hljs-keyword">this</span>.folder = folder;
    m.extendObservable(<span class="hljs-keyword">this</span>, {
        collapsed: <span class="hljs-literal">false</span>,
    get name() {
            <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.folder.name;
    },
        get isVisible() {
            <span class="hljs-keyword">return</span> !<span class="hljs-keyword">this</span>.state.filter || <span class="hljs-keyword">this</span>.name.indexOf(<span class="hljs-keyword">this</span>.state.filter) !== <span class="hljs-number">-1</span> || <span class="hljs-keyword">this</span>.children.some(child =&gt; child.isVisible);
    },
        get children() {
            <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.collapsed)
                <span class="hljs-keyword">return</span> [];
            <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.folder.children.map(transformFolder).filter(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">child</span>) </span>{
                <span class="hljs-keyword">return</span> child.isVisible;
            })
    },
        get path() {
            <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.folder.parent === <span class="hljs-literal">null</span> ? <span class="hljs-keyword">this</span>.name : transformFolder(<span class="hljs-keyword">this</span>.folder.parent).path + <span class="hljs-string">&quot;/&quot;</span> + <span class="hljs-keyword">this</span>.name;
        })
    });
}

<span class="hljs-keyword">var</span> state = m.observable({
    root: <span class="hljs-keyword">new</span> Folder(<span class="hljs-literal">null</span>, <span class="hljs-string">&quot;root&quot;</span>),
    filter: <span class="hljs-literal">null</span>,
    displayRoot: <span class="hljs-literal">null</span>
});

<span class="hljs-keyword">var</span> transformFolder = m.createTransformer(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">folder</span>) </span>{
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> DisplayFolder(folder, state);
});

<span class="hljs-comment">// &#x8FD4;&#x56DE;&#x6BCF;&#x4E2A;&#x6587;&#x4EF6;&#x5939;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x5217;&#x8868;</span>
<span class="hljs-keyword">var</span> stringTransformer = m.createTransformer(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">displayFolder</span>) </span>{
    <span class="hljs-keyword">var</span> path = displayFolder.path;
    <span class="hljs-keyword">return</span> path + <span class="hljs-string">&quot;\n&quot;</span> +
        displayFolder.children.filter(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">child</span>) </span>{
            <span class="hljs-keyword">return</span> child.isVisible;
        }).map(stringTransformer).join(<span class="hljs-string">&apos;&apos;</span>);
});

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">createFolders</span>(<span class="hljs-params">parent, recursion</span>) </span>{
    <span class="hljs-keyword">if</span> (recursion === <span class="hljs-number">0</span>)
        <span class="hljs-keyword">return</span>;
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">3</span>; i++) {
        <span class="hljs-keyword">var</span> folder = <span class="hljs-keyword">new</span> Folder(parent, i + <span class="hljs-string">&apos;&apos;</span>);
        parent.children.push(folder);
        createFolders(folder, recursion - <span class="hljs-number">1</span>);
    }
}

createFolders(state.root, <span class="hljs-number">2</span>); <span class="hljs-comment">// 3^2</span>

m.autorun(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
    state.displayRoot = transformFolder(state.root);
    state.text = stringTransformer(state.displayRoot)
    <span class="hljs-built_in">console</span>.log(state.text)
});

state.root.name = <span class="hljs-string">&apos;wow&apos;</span>; <span class="hljs-comment">// &#x6539;&#x53D8;&#x6587;&#x4EF6;&#x5939;&#x540D;&#x79F0;</span>
state.displayRoot.children[<span class="hljs-number">1</span>].collapsed = <span class="hljs-literal">true</span>; <span class="hljs-comment">// &#x6298;&#x53E0;&#x6587;&#x4EF6;&#x5939;</span>
state.filter = <span class="hljs-string">&quot;2&quot;</span>; <span class="hljs-comment">// &#x641C;&#x7D22;</span>
state.filter = <span class="hljs-literal">null</span>; <span class="hljs-comment">// &#x53D6;&#x6D88;&#x641C;&#x7D22;</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="expr.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 6.11. mobxUtils.expr">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"6.10. mobxUtils.createTransformer","level":"1.6.10","depth":2,"next":{"title":"6.11. mobxUtils.expr","level":"1.6.11","depth":2,"path":"refguide/expr.md","ref":"refguide/expr.md","articles":[]},"previous":{"title":"6.9. mobxUtils.now","level":"1.6.9","depth":2,"anchor":"#now","url":"https://github.com/mobxjs/mobx-utils#now","ref":"https://github.com/mobxjs/mobx-utils#now","articles":[]},"dir":"ltr"},"config":{"plugins":["github","edit-link","anchors","copy-code-button","github-buttons"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/SangKa/mobx-docs-cn"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"github-buttons":{"buttons":[{"user":"SangKa","repo":"MobX-Docs-CN","type":"star","size":"small","count":true},{"user":"SangKa","repo":"MobX-Docs-CN","type":"fork","size":"small","count":true}]},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"完善文档","base":"https://github.com/SangKa/mobx-docs-cn/tree/master/docs"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"MobX 中文文档","gitbook":"3.2.2"},"file":{"path":"refguide/create-transformer.md","mtime":"2018-04-07T14:34:40.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-09-18T13:06:52.064Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

